package com.example.paimengshop;

import com.example.paimengshop.dataclass.Commodity;
import com.example.paimengshop.dataclass.Order;
import com.example.paimengshop.dataclass.User;

import java.util.ArrayList;

public class Data {
    public static User currentUser=new User();//当前用户  唯一性 从服务器获取

    public static ArrayList<Commodity> allCommodity=new ArrayList<>();//所有商品 从服务器获取

    public static ArrayList<Order> orders=new ArrayList<>();//所有订单，从服务器获取（获取所有购买者为当前登录用户的订单）

    public static boolean userSendOver = false;
    public static boolean orderSendOver = false;
    public static boolean commoditySendOver = false;

    public static User getCurrentUser()
    {
        return currentUser;
    }

    public static void setCurrentUser(User currentUser)
    {
        Data.currentUser = currentUser;
    }

    public static ArrayList<Commodity> getAllCommodity()
    {
        return allCommodity;
    }

    public static void setAllCommodity(ArrayList<Commodity> allCommodity)
    {
        Data.allCommodity = allCommodity;
    }

    public static ArrayList<Order> getOrders()
    {
        return orders;
    }

    public static void setOrders(ArrayList<Order> orders)
    {
        Data.orders = orders;
    }

    public static void setUserSendOver(boolean userSendOver)
    {
        Data.userSendOver = userSendOver;
    }

    public static boolean isUserSendOver()
    {
        return userSendOver;
    }

    public static void setOrderSendOver(boolean orderSendOver)
    {
        Data.orderSendOver = orderSendOver;
    }

    public static boolean isOrderSendOver()
    {
        return orderSendOver;
    }

    public static void setCommoditySendOver(boolean commoditySendOver)
    {
        Data.commoditySendOver = commoditySendOver;
    }

    public static boolean isCommoditySendOver()
    {
        return commoditySendOver;
    }
}
